<!--查看升级原因-->
<div id="reason-modal" style="top: 20%;" class="modal fade modal_small" role="dialog" aria-labelledby="myModalLabel1" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true"></button>
                <h4 class="modal-title"></h4>
            </div>
            <div class="modal-body">
                <table class="table table-bordered">
                    <tbody class="reason-table">
                        <tr>
                            <td width="20%">调整等级</td>
                            <td width="60%">调整原因</td>
                            <td width="20%">调整时间</td>
                        </tr>
                    </tbody>
                </table>
            </div>
            <div class="modal-footer">
                <button class="btn default" data-dismiss="modal" aria-hidden="true"><i class="fa fa-times"></i> 关闭</button>
                <script type="text/javascript">
                    $(function() {
                        var modal = $('#reason-modal');
                        $('.reason').live('click',function () {
                            var id = $(this).attr('data-id');
                            $(".dier").remove();
                            l_blockUI();
                            $.ajax('<?php echo getUrl('member/merchant/reason')?>?id='+id, {
                                dataType:'json',
                                type:'get',
                                error:function(){
                                    show_message({status:0, info:'请求超时'});
                                    App.unblockUI();
                                },
                                timeout:60000,
                                success:function(data,textStatus,jqXHR){
                                    if(data.status == 0){
                                        show_message({status:0, info:'请求超时'});
                                        return;
                                    }

                                    if (data.data.length) {
                                        var html;
                                        $.each(data.data, function (key, obj) {
                                            html = '<tr class="dier">' +
                                                '<td>' + obj.rank_name + '</td>' +
                                                '<td>' + obj.reason + '</td>' +
                                                '<td>' + obj.addtime + '</td>' +
                                                '</tr>';
                                            $(".reason-table").append(html);
                                        });
                                    }else{
                                        $(".modal-body").html('<div id="body-container">'+
                                            '<div class="warps-textCons">'+
                                            '<h1>暂无升级记录</h1>'+
                                            '</div>'+
                                            '</div>');
                                    }

                                    modal.find('.modal-title').html('调整原因');
                                    modal.find('.has-error').removeClass('has-error').find('.validate_message').remove();
                                    modal.find('.show_message_error').remove();
                                    modal.modal();
                                    App.unblockUI();
                                }
                            }, 'json');
                            return false;
                        });
                    });
                </script>
            </div>
        </div>
    </div>
</div>